﻿using System;

namespace Beeflys
{
    public static class ActorSystem
    {
        static ActorSystem()
        {
            AppDomain.CurrentDomain.UnhandledException += OnCurrentDomainException;
        }

        public static string version { get; set; } = string.Empty;
        public static IFormater Formater { get; set; } = new DefaultFormater();



        private static void OnCurrentDomainException(object sender, UnhandledExceptionEventArgs e)
        {
            var ex = e.ExceptionObject as Exception;
            if (ex == null)
            {
                return;
            }

            Logger.Current.Error(e.ToString());
        }
    }
}
